package es.udc.emarketapp.emarket.model.shippingFacade.actions;

import java.sql.Connection;

import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import es.udc.fbellas.j2ee.util.sql.TransactionalPlainAction;
import es.udc.emarketapp.emarket.model.shipping.dao.SQLShippingDAO;
import es.udc.emarketapp.emarket.model.shipping.dao.SQLShippingDAOFactory;
import es.udc.emarketapp.emarket.model.shipping.vo.ShippingVO;

public class CreateShippingAction implements TransactionalPlainAction {

    private ShippingVO shippingVO;
    
    public CreateShippingAction(ShippingVO shippingVO) {
        this.shippingVO = shippingVO;
    }
    
    public Object execute(Connection connection) 
        throws InternalErrorException {        

        SQLShippingDAO shippingDAO = SQLShippingDAOFactory.getDAO();

        return shippingDAO.create(connection, shippingVO);

    }


}
